﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace CMTVision.Widgets
{
    public partial class ShowWidgetsWithoutTemplate : CMTVision.Widgets.Impls.TemplatePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            ForceRefresh();
        }


        protected void EditButton_Click(object sender, EventArgs e)
        {
            IsInEditMode = !IsInEditMode;
            ForceRefresh();
            EditButton.Text = IsInEditMode ? "StopEdit" : "Edit";
        }

         
         

        protected override void CreateChildControls()
        {
            PageID = 1;
            IsInEditMode = true;
            base.CreateChildControls(); 
            Template0.TemplateDataID = 1;
            Template0.IsInEditMode = true;
            Template0.LoadTemplateColumns();

        }

        public override void ForceRefresh()
        {
            Template0.IsInEditMode = IsInEditMode;
            Template0.ForceRefresh();
            //base.ForceRefresh();
        }

        public override Control FindControl(string id)
        {
            return (Template as Control).FindControl(id) ?? base.FindControl(id);
        }
    }
}